<%@ include file="/WEB-INF/views/public/include.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<!-- 页面编码 -->
	<meta charset="utf-8">
  	<!-- 手机浏览器禁止缩放, 页面大小默认为手机屏幕宽度 -->
  	<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
  	<!-- 允许IOS全屏显示网页 -->
  	<meta content="yes" name="apple-mobile-web-app-capable" />
  	<!-- 设置IOS状态栏为透明底色 -->
	<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
	<!-- 设置360浏览器渲染引擎为webkit -->
  	<meta name="renderer" content="webkit">
  	<!-- 设置APP标题 -->
  	<meta name="apple-mobile-web-app-title" content="青年电影志">
  	<!-- 关闭自动识别电话号码 -->
  	<meta name="format-detection" content="telephone=no">
	<!-- iPhone桌面图标 -->
	<link href="/resources/static/images/app-60@2x.png" sizes="120x120" rel="apple-touch-icon-precomposed">
  	<!-- 页面标题 -->
  	<title>约见申请</title>

  	<!-- 基本样式载入 -->
  	<link rel="stylesheet" href="/resources/static/css/ionicons.min.css">
	<link rel="stylesheet" href="/resources/static/css/public.css">
	<!-- 基本脚本载入 -->
	<script src="/resources/static/js/plugins.min.js"></script>
</head>
<body>
	<div id="app" class="site" data-controller="dashPage">
		<div class="bar bar-footer bar-primary">
			<nav class="bar-navigation">
				<a class="menu-item" href="/main/index">
					<i class="menu-icon ico-home"></i>
					<span class="menu-label">首页</span>
				</a>
				<a class="menu-item" href="/main/discovery">
					<i class="menu-icon ico-discovery"></i>
					<span class="menu-label">发现</span>
				</a>
				<a class="menu-item is-active" href="/main/user/index">
					<i class="menu-icon ico-me"></i>
					<span class="menu-label">我的</span>
				</a>
			</nav>
			<!-- END .bar-navigation -->
		</div>
		<div id="content" class="site-content">
			<div class="inner">
				<div class="nav-group" role="group">
					<a href="?status=0" <c:if test="${status == 0}">class="is-active"</c:if> >进行中</a>
					<a href="?status=1" <c:if test="${status == 1}">class="is-active"</c:if> >待评价</a>
					<a href="?status=2" <c:if test="${status == 2}">class="is-active"</c:if> >已结束</a>
				</div>
				<c:forEach var="application" items="${applications}">
					<article class="order-view">
						<div class="order-content">
							<div class="people-avatar">
								<img src="${application.star.picUrl}" alt="">
								<span class="people-name">${application.star.getName()}</span>
							</div>
							<!-- END .people-avatar -->
							<div class="people-content">
								<div class="top-meta">
									<span class="pull-left">约见话题</span>
									<span class="pull-right">${application.price} 元/小时</span>
								</div>
								<h3 class="people-title">${application.subjectTitle}</h3>
								<span class="people-pos">${application.star.profession}</span>
							</div>
							<!-- END .people-content -->
							<a href="/main/user/application/mine/single?applicationId=${application.id}" class="overlay-link"></a>
						</div>
						<!-- END .order-content -->
							<c:choose>
								<%-- 进行中 --%>
								<c:when test="${application.status == 0}">
								<div class="order-meta">
									<div class="pull-left">订单状态:<span class="state-success">等待支付</span></div>
									<div class="pull-right clearfix">
										<a href="/main/pay/pay?applicationId=${application.id}" class="state-info">去支付</a>
									</div>
								</div>
								</c:when>

								<c:when test="${application.status == 1}">
								<div class="order-meta">
										<div class="pull-left">订单状态:<span class="state-success">支付成功，待对方处理</span></div>
								</div>
								</c:when>

								<%-- 待评价 --%>

								<c:when test="${application.status == 2}">
									<c:choose>
										<c:when test="${application.userComment}">
											<div class="order-meta">
												<div class="pull-left">订单状态:<span class="state-success">等待评价</span></div>
												<div class="pull-right clearfix">
													<a href="#" class="state-info">已经评价，待对方评价</a>
												</div>
											</div>
										</c:when>
										<c:when test="${!application.userComment}">
											<div class="order-meta">
												<div class="pull-left">订单状态:<span class="state-success">等待评价</span></div>
												<div class="pull-right clearfix">
													<a href="./mine/comment?applicationId=${application.id}" class="state-info">评价</a>
												</div>
											</div>
										</c:when>
										<c:otherwise></c:otherwise>
									</c:choose>
								</c:when>
								<%-- 已完成 --%>
								<c:when test="${application.status == 3}">
								<div class="order-meta">
									<div class="pull-left">订单状态:<span class="state-success">已评价</span></div>
								</div>
								</c:when>
								<c:when test="${application.status == 4}">
								<div class="order-meta">
									<div class="pull-left">订单状态:<span class="state-success">已付款</span></div>
								</div>
								</c:when>
								<c:when test="${application.status == -1}">
								<div class="order-meta">
									<div class="pull-left">订单状态:<span class="state-success">等待退款</span></div>
								</div>
								</c:when>
								<c:when test="${application.status == -2}">
								<div class="order-meta">
									<div class="pull-left">订单状态:<span class="state-success">已退款</span></div>
								</div>
								</c:when>
								<c:otherwise></c:otherwise>
							</c:choose>
					</article>
				</c:forEach>
				<c:if test="${applications == null || applications.size() == 0}">
					<div class="no-yuejian">
						<i class="ion-coffee"></i>
						<p>你没有进行中的约见哦<br>快去预约你感兴趣的话题吧</p>
						<a href="/main/discovery" class="hang-link">随便看看</a>
					</div>
				</c:if>
				<!-- END .order-view -->
			</div>
			<!-- END .inner -->
		</div>
		<!-- END #content -->
	</div>
	<!-- END #page -->
	<!-- 页面脚本载入 -->
	<script src="/resources/static/js/app.js"></script>
</body>
</html>